/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package edu.marist.cs.os.g3;

import edu.marist.cs.os.g3.mos.Block;
import edu.marist.cs.os.g3.mos.Word;
import edu.marist.cs.os.g3.processors.CPU;

/**
 *
 * @author Intern
 */
public class Test {
    
    static CPU cpu;
    public static void main(String[] args) {
        Word word = new Word("GD50");
        System.out.println(word);   
        
        Block block = new Block("GD50GD50GD50GD50GD50GD50GD50GD50GD50GD50");
        System.out.println(block.toString());
        
        String bitString = String.format("%3s", Integer.toBinaryString(0)).replace(' ', '0');
        System.out.println(bitString);
        
        cpu = new CPU();
        
        cpu.C = true;
        cpu.IC = 2;
        cpu.PTR = 29;
        cpu.R = "HELO";
        cpu.SI = 2;
        cpu.IOI = 0;
        cpu.PI = 1;
        cpu.TI = 2;
        cpu.IR = "GD50";
        cpu.mode = CPU.Mode.SLAVE;
        printRegisters();
        
    }

     public static void printRegisters() {
        System.out.println("MODE: " + cpu.mode.toString() + "  PTR: " + cpu.PTR + "  PI: " + cpu.PI + "  SI: " + cpu.SI + "  TI " + cpu.TI + "  IOI: " + cpu.IOI + "  IR: " + cpu.IR + "  IC: " + String.format("%02d", cpu.IC) + "  R: " + cpu.R + "  C: " + (cpu.C ? "T" : "F"));
    }

}
